package 分类.链表;

public class 链表的中间结点 {
    public ListNode middleNode(ListNode head) {
        ListNode slow,fast;
        slow=fast=head;
        while (fast!=null&&fast.next!=null){
            slow=slow.next;
            fast=fast.next.next;
        }
        return slow;
    }
}
